package com.xw.wuliu.adapter.item;

import com.xw.model.FuncData;
import com.xw.wuliu.R;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

public class FuncItem extends LinearLayout{

	private TextView mTv;
	private LayoutInflater mLI;
	private Context mContext;
	
	public FuncItem(Context aContext,LayoutInflater aLI) {
		super(aContext);
		mLI = aLI;
		mContext = aContext;
		 init();
	}
	
	private void init(){
		mLI.inflate( R.layout.item_main_gv, this,true );
		mTv = ( TextView ) findViewById( R.id.tv_gv_item );
	}
	
	public void setView(FuncData data){
		Drawable db = mContext.getResources().getDrawable( data.icon );
        db.setBounds(0, 0, db.getMinimumWidth(), db.getMinimumHeight());
        mTv.setCompoundDrawables( null, db, null, null );
        mTv.setText( data.name );
	}

}
